package bTree.LeetCode;

import java.util.Arrays;

public class 你能构造出连续值的最大数目 {
    public int getMaximumConsecutive(int[] coins) {
        Arrays.sort(coins);
        int current=0;
        for (int coin : coins) {
            int i = current + 1;
            if (coin>i){
                return current+1;
            }
            current+=coin;
        }
        return current+1;
    }
}